package com.atguigu.juc.t7;

public class T1 {
    public static void main(String[] args) {
        Printer printer = new Printer();

        new Thread(()->{
            for (int i = 0; i < 20; i++) {
                printer.print0();
            }
        },"小程：").start();

        new Thread(()->{
            for (int i = 0; i < 20; i++) {
                printer.print0();
            }
        },"小程的助手：").start();

        new Thread(()->{
            for (int i = 0; i < 20; i++) {
                printer.print1();
            }
        },"老王：").start();

        new Thread(()->{
            for (int i = 0; i < 20; i++) {
                printer.print1();
            }
        },"老王的助手：").start();
    }
}
